#include<iostream>
#include<string>
using namespace std;

string a, b;

int main()
{
    cin >> a >> b;
    size_t pos = a.find_first_of(b);
    while (pos != string::npos)
    {
        a.erase(pos, 1);
        pos = a.find_first_of(b);
    }
    cout << a << endl;
    return 0;
}